﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using JobUtil.BllLib;
using JobUtil.GeneralLib;

namespace JobUtil.Controls
{
    public partial class CheckControl : UserControl
    {
        public CheckControl()
        {
            InitializeComponent();
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            bool PWDEV      = new TestBusiness().TestQuery("DbConnectionString_PWDEV");
            bool PWACC      = new TestBusiness().TestQuery("DbConnectionString_PWACC");
            bool PWPRD      = new TestBusiness().TestQuery("DbConnectionString_PWPRD");
            bool INADEV     = new TestBusiness().TestQuery("DbConnectionString_INADEV");
            bool INAACC     = new TestBusiness().TestQuery("DbConnectionString_INAACC");
            bool INAPRD     = new TestBusiness().TestQuery("DbConnectionString_INAPRD");

            string pwDevName    = "PW Dev";
            string pwAccName    = "PW Acc";
            string pwPrdName    = "PW Prd";
            string inaAevName   = "INA Dev";
            string inaAccName   = "INA Acc";
            string inaPrdName   = "INA Prd";
            
            var dataTab  = new List<DbStatus>();
            
            // PW
            dataTab.Add(new DbStatus() { dbName = pwDevName, dbStatus = PWDEV });
            dataTab.Add(new DbStatus() { dbName = pwAccName, dbStatus = PWACC });
            dataTab.Add(new DbStatus() { dbName = pwPrdName, dbStatus = PWPRD });

            //INA
            dataTab.Add(new DbStatus() { dbName = inaAevName, dbStatus = INADEV });
            dataTab.Add(new DbStatus() { dbName = inaAccName, dbStatus = INAACC });
            dataTab.Add(new DbStatus() { dbName = inaPrdName, dbStatus = INAPRD });



            CheckDataGrid.DataSource = dataTab;
           

        }

        private void CheckControl_Load(object sender, EventArgs e)
        {


        }

        private void CheckControl_Paint(object sender, PaintEventArgs e)
        {


        }

        private void InaPW_Click(object sender, EventArgs e)
        {

        }
    }
}
